package com.pristine.main;


import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.pristine.domain.PatientEntity;
import com.pristine.service.wsdl.IPatientService;

public class PatientTest {

	private IPatientService emService = null;
	private ConfigurableApplicationContext context = null; 
	@Before
	public void setUp() throws Exception {
		context = new ClassPathXmlApplicationContext("applicationContext.xml");
		emService = (IPatientService) context.getBean("patientService");
		
	}

	@After
	public void tearDown() throws Exception {
		emService = null;
		context.close();
	}
	@Test
	public void createPatient(){
		PatientEntity entity = new PatientEntity();
		
		
		//Integer id = emService.createPatient(entity);
		
		//Assert.assertTrue(id>=0);
	}
	
	@Test
	public void updatePatient(){
		PatientEntity entity = new PatientEntity();
		
		
		//emService.createPatient(entity);
		
		
		
		//emService.updatePatient(entity);
		
		//Assert.assertEquals(entity.getCatTypeName(), "Doctor");
		
		
	}
	
	@Test
	public void deletePatient(){
		PatientEntity entity = new PatientEntity();
		
		
		//Integer id = emService.createPatient(entity);
		
		//PatientEntity masterEntity = emService.getPatientById(id);
		
		//emService.deletePatient(masterEntity);
		
		//PatientEntity masterEntity1 = emService.getPatientById(id);
		
		//Assert.assertTrue(masterEntity1 == null);
		
		
	}
}

